package com.xzl;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import redis.clients.jedis.Jedis;

@SpringBootApplication
@MapperScan({"com.xzl.manger.dao","com.xzl.shop.dao"})
@ServletComponentScan
@EnableScheduling
public class App
{
    @Value("${redis.host}")
    private String host;
    @Value("${redis.port}")
    private Integer port;
    @Value("${redis.db}")
    private Integer db;
    @Bean
    public Jedis getJedis(){
        Jedis jd = new Jedis(host,port);
        jd.select(db);
        return jd;
    }
    public static void main( String[] args )
    {
        SpringApplication.run(App.class);
        System.err.println("管理: "+"localhost:8080/shop/mage/login");
        System.err.println("用户: "+"localhost:8080/shop/user/login");
    }
}
